import 'package:flutter/material.dart';
import 'package:sui_shou_pai/module/top_bar.dart';
import 'package:sui_shou_pai/record/record_card_list_all.dart';
import 'package:sui_shou_pai/record/record_card_list_type1.dart';
import 'package:sui_shou_pai/record/record_card_list_type2.dart';

class RecordPage extends StatefulWidget {
  RecordPage({Key key}) : super(key: key);

  @override
  _RecordPageState createState() => _RecordPageState();
}

class _RecordPageState extends State<RecordPage> with TickerProviderStateMixin {
  String title = '记录';
  List<Tab> tabLabels = [
    Tab(text: '所有记录'),
    Tab(text: '环境整改'),
    Tab(text: '环境分享'),
  ];

  TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: tabLabels.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: initAppBar(title, tabLabels, _tabController),
      body: TabBarView(
        controller: _tabController,
        children: <Widget>[
          RecordCardListAll(),
          RecordCardListType1(),
          RecordCardListType2(),
        ],
      ),
    );
  }
}
